<!DOCTYPE html>
<html lang="en">

<script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script>
    function run() {
        var string = document.getElementById("string").value;
        var pattern = document.getElementById("pattern").value;

        $.ajax({
            type: "GET",
            url: "/api/v1/findall?string=" + string + "&pattern=" + pattern,
            data: {},
            success: function (result) {
                console.log(result);
                document.getElementById("result").value = result;
            },
            error: function () {
                console.error("error");
            }
        });
    }

</script>

<head>
    <meta charset="UTF-8">
    <title>Python 正则试验</title>
</head>

<body>
    <div style="margin: auto auto; text-align: center;">
        <textarea id="string" rows="5" cols="30" placeholder="请输入字符串"></textarea><br />
        <textarea id="pattern" rows="5" cols="30" placeholder="请输入正则表达式"></textarea><br />
        <button onclick="run()">验证</button><br />
        <textarea id="result" rows="5" cols="30" placeholder="匹配结果"></textarea>
    </div>
</body>

</html>